﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Yugi_Gui.LayoutManager;
using Yugi.Client.ViewModel;
using Yugi.Client;
namespace Yugi_Gui
{
	/// <summary>
	/// Interaction logic for LoginLayout.xaml
	/// </summary>
	public partial class Yugiohvietnam : UserControl , IInvoke
    {
        MainServerHandler mainserver;
        YugiohVietNamModel model;
        public Yugiohvietnam()
		{
			this.InitializeComponent();
            this.Loaded += new RoutedEventHandler(Yugiohvietnam_Loaded);
		}

        void Yugiohvietnam_Loaded(object sender, RoutedEventArgs e)
        {
            mainserver = ((Window)(this.Parent)).DataContext as MainServerHandler;
            model = mainserver.YugiohVietNam_Model;
            model.Presenter = this;
        }


        #region IInvoke Members

        public void Do(ClientMSG msg, params object[] obj)
        {
            

        }

        public void Refresh()
        {

        }
        #endregion

        public void selectmenu()
        {
            switch (model.select)
            {
                case 1: LayoutManager.LayoutManager.Insitance.ChangeToLayout(LayoutManager.LayoutType.Externa); break;
            }
        }
        private void rectangle1_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            string obj = ((Rectangle)sender).Name;
            switch (obj)
            {
                case "img_select1": model.select = 1; break;
                case "img_select2": model.select = 2; break;
                case "img_select3": model.select = 3; break;
                case "img_select4": model.select = 4; break;
            }
            selectmenu();
        }

        private void img_select4_MouseEnter(object sender, MouseEventArgs e)
        {
            ((Rectangle)sender).Opacity = 0.4;
        }

        private void img_select4_MouseLeave(object sender, MouseEventArgs e)
        {
            ((Rectangle)sender).Opacity = 0;
        }

    }
}